/**
 * Created by Administrator on 2017/5/17.
 */

var access_token = 'jDPyiKTk4emwlQbjdlmNrICikwdQhwVPghivKAg_ThZ237EWNAJmDvAYXBs2KWm3yxTvlcoEIkltsMKaaR1rZKvDhyDNaa5Hz1X4cjDCOD5Q8OafactepUSmpaKhZgejCODcAIARDS';
var qrcode='{"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}'
// var url = 'https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' + access_token;
var url = 'https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=jDPyiKTk4emwlQbjdlmNrICikwdQhwVPghivKAg_ThZ237EWNAJmDvAYXBs2KWm3yxTvlcoEIkltsMKaaR1rZKvDhyDNaa5Hz1X4cjDCOD5Q8OafactepUSmpaKhZgejCODcAIARDS' ;

var request = require('request');

request({
    url: url,
    method: "POST",
    json: true,
    headers: {
        "content-type": "application/json",
    },
    body: {"expire_seconds": 604800, "action_name": "QR_SCENE", "action_info": {"scene": {"scene_id": 123}}}
}, function(error, response, body) {
    console.log(JSON.stringify(response));
    if (!error && response.statusCode == 200) {
    }
});